using System.Linq;
using Comteck.Dto.Sys;
using Comteck.Entities.Sys;

namespace Comteck.Ktt.Services.SeedData {
  /// <summary>
  /// 全局参数
  /// </summary>
  public class _20250429001_Parameter : IDataSeed {
    /// <summary>
    /// 
    /// </summary>
    /// <param name="context"></param>
    public void Init(AppDbContext context) {
      if (!context.Parameter.Any()) {
        context.Parameter.Add(new Parameter {
          Id = EnumParameter.order_weight.ToString().ToLower(),
          Name = "订单重量阈值(单位:斤)",
          Value = "10"
        });

        context.Parameter.Add(new Parameter {
          Id = EnumParameter.ems_config.ToString().ToLower(),
          Name = "ems配置信息",
          Value = @"{""BaseUrl"":""https://api.ems.com.cn/amp-prod-api/f/amp/api/open"",""SenderNo"":""1100216006153"",""Authorization"":""SIpelFruAbOyF32o"",""Key"":""WHVyVk1BWUpSNEs0enFvNg==""}"
        });

        context.Parameter.Add(new Parameter {
          Id = EnumParameter.ems_sender.ToString().ToLower(),
          Name = "ems发件人",
          Value = @"{""Name"":""118水果团"",""PostCode"":null,""Phone"":""15824138888"",""Mobile"":""15824138888"",""Prov"":""浙江省"",""City"":""杭州市"",""County"":""萧山区"",""Address"":""118水果团""}"
        });

        context.SaveChanges();
      }

    }
  }
}
